﻿using System;

namespace NMemcached.Client
{
    /// <summary>
    /// Defines the operation code constants for all binary commands
    /// </summary>
    internal enum OpCode : byte
    {
        /// <summary>
        /// Get an item from the cache
        /// </summary>
        Get = 0x0,
        /// <summary>
        /// Set an item in the cache
        /// </summary>
        Set = 0x01,
        /// <summary>
        /// Add an item to the cache
        /// </summary>
        Add = 0x02,
        /// <summary>
        /// Replace an item in the cache
        /// </summary>
        Replace = 0x03,
        /// <summary>
        /// Delete an item from the cache
        /// </summary>
        Delete = 0x04,
        /// <summary>
        /// Increment a value in the cache
        /// </summary>
        Increment = 0x05,
        /// <summary>
        /// Decrement a value in the cache
        /// </summary>
        Decrement = 0x06,
        /// <summary>
        /// Close the connection
        /// </summary>
        Quit = 0x07,
        /// <summary>
        /// Flush all items from the cache
        /// </summary>
        Flush = 0x08,
        /// <summary>
        /// Get an item from the cache with no response
        /// </summary>
        GetQuietly = 0x09,
        /// <summary>
        /// No operation
        /// </summary>
        NoOperation = 0x0A,
        /// <summary>
        /// Get the version of the server
        /// </summary>
        Version = 0x0B,
        /// <summary>
        /// Get an item from the cache with its key
        /// </summary>
        GetWithKey = 0x0C,
        /// <summary>
        /// Get an item from the cache with its key with no response
        /// </summary>
        GetWithKeyQuietly = 0x0D,
        /// <summary>
        /// Append a value to an entry in the cache
        /// </summary>
        Append = 0x0E,
        /// <summary>
        /// Prepend a value to an entry in the cache
        /// </summary>
        Prepend = 0x0F,
        /// <summary>
        /// Get the statistics for the server
        /// </summary>
        Stat = 0x10,
        /// <summary>
        /// Set an item in the cache with no response
        /// </summary>
        SetQuietly = 0x11,
        /// <summary>
        /// Add an item to the cache with no response
        /// </summary>
        AddQuietly = 0x12,
        /// <summary>
        /// Replace an item in the cache with no response
        /// </summary>
        ReplaceQuietly = 0x13,
        /// <summary>
        /// Delete an item from the cache with no response
        /// </summary>
        DeleteQuietly = 0x14,
        /// <summary>
        /// Increment a value in the cache with no response
        /// </summary>
        IncrementQuietly = 0x15,
        /// <summary>
        /// Decrement a value in the cache with no response
        /// </summary>
        DecrementQuietly = 0x16,
        /// <summary>
        /// Close the connection with no response
        /// </summary>
        QuitQuietly = 0x17,
        /// <summary>
        /// Flush all items from the cache with no response
        /// </summary>
        FlushQuietly = 0x18,
        /// <summary>
        /// Append a value to a cache entry with no response
        /// </summary>
        AppendQuietly = 0x19,
        /// <summary>
        /// Prepend a value to a cache entry with no response
        /// </summary>
        PrependQuietly = 0x1A
    };
}
